package com.example.myowntodo.testui;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;

import com.example.myowntodo.R;
import com.example.myowntodo.databinding.TestNotificationBinding;

//public class TestNotification extends AppCompatActivity {
//    private TestNotificationBinding binding;
//
//    private NotificationManager notificationManager;
//    private Notification notification;
//
//
//
//    @Override
//    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
//        super.onCreate(savedInstanceState, persistentState);
//        binding = TestNotificationBinding.inflate(getLayoutInflater());
////        setContentView(binding.getRoot());
////        TODO: oh man, why blank page
//        setContentView(R.layout.test_notification);
//
//        notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
//
//
////        Intent thenAct = new Intent(this, NotifyThenActivity.class);
////        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, thenAct, PendingIntent.FLAG_IMMUTABLE);
//
//
//        notification = new NotificationCompat.Builder(this, "hello")
//                .setContentTitle("官方通知")
//                .setContentText("what the fuck")
//                .setSmallIcon(R.drawable.ic_food)
////                .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.about_logo))
////                .setContentIntent(pendingIntent)
//                .setAutoCancel(true)
//                .build();
//
//
//
//
//    }
//
//    public void sentNotification(View view) {
//        // 需要permission
//        notificationManager.notify(1, notification);
//    }
//
//    public void cancelNotification(View view) {
//        notificationManager.cancel(1);
//    }
//
//
//
//}
